package cloud.misiro.spring.cloud.discovery;

import cloud.misiro.spring.cloud.MiniDiscoveryProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MiniDiscoveryAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public MiniDiscoveryProperties miniDiscoveryProperties() {
        return new MiniDiscoveryProperties();
    }

    @Bean
    public MiniDiscoveryClient miniDiscoveryClient(MiniDiscoveryProperties miniDiscoveryProperties) {
        return new MiniDiscoveryClient(miniDiscoveryProperties);
    }
}
